/*
 * main.c
 *
 *  Created on: 27 janv. 2009
 *      Author: johan
 */

#include <avr/io.h>
#include <avr/delay.h>
#include "ioinit.h"

int main(void) {
	ioinit();

	for (;;) {
		// LED ON : PORTC = PORTC | 00000001
		// _BV : Converts a bit number into a byte value.
		PORTC |= _BV(PC0);
		_delay_ms(200);

		// LED OFF : PORTC = PORTC & 11111110
		PORTC &= ~_BV(PC0);
		_delay_ms(200);
	}

	return (1);

	ADMUX |= _BV(REFS0) | _BV(REFS1);
	ADCSRA |= _BV(ADEN);	/* Enable ADC */
	ADCSRA |= _BV(ADIE);	/* ADC Interrupt Enable */
	ADCSRA |= _BV(ADPS0) | _BV(ADPS1) | _BV(ADPS2);	/* ADC Prescaler Select Bits */

	ADCSRA |= _BV(ADSC);	/* Start Convertion */
}
